// -------- import official less file -----------
@import "../node_modules/ng-zorro-antd/ng-zorro-antd.less";

@import "../node_modules/ng-zorro-antd/code-editor/style/entry.less";

@import "app/core/components/prism/prism.theme.less";

// Override less variables to here
// View all variables: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/style/themes/default.less

@import "styles/nz-select.less";
@import "styles/nz-input.less";
@import "styles/nz-tabset.less";
@import "styles/icon.less";
@import "styles/nz-segmented.less";
@import "styles/standards.less";
@import "styles/nz-drawer.less";
@import "styles/nz-modal.less";
@import "styles/nz-collapse.less";
@import "variables";

html,
body,
app-root {
  width: 100%;
  overflow: hidden;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ant-card-actions {
  padding: 6px 0 7px 0;
}

.menu-list li a i {
  font-size: 20px;
  height: 20px;
  width: 20px;
}

.ant-menu-inline,
.ant-menu-vertical,
.ant-menu-vertical-left {
  border-right: none;

  .ant-menu-submenu>.ant-menu-submenu-title {

    .ant-menu-submenu-arrow,
    &:hover {
      color: rgb(79, 91, 103);
    }

    .anticon {
      font-size: 20px;
      color: rgb(113, 125, 138);

      &+span {
        margin-left: 20px;
        font-size: 14px;
      }
    }
  }
}

// scroll bar
/* width */
::-webkit-scrollbar {
  width: 14px;
  height: 8px;
}

/* Track */
::-webkit-scrollbar-track {
  border-radius: 12px;
  box-shadow: inset 0 0 12px 12px #d9d9d9;
  border: solid 3px transparent;
}

/* Handle */
::-webkit-scrollbar-thumb {
  box-shadow: inset 0 0 12px 12px #a8a8a8;
  border: solid 3px transparent;
  border-radius: 12px;
}

// /* Handle on hover */
// ::-webkit-scrollbar-thumb:hover {
//   background: @primary-color;
//   border-left: solid 3px transparent;
//   border-right: solid 3px white;
//   border-top: solid 3px #D9D9D9;
//   border-bottom: solid 3px #D9D9D9;
// }

// customize tooltip
.ant-tooltip-arrow-content {
  --antd-arrow-background-color: @grey60-color;
}

.ant-tooltip-inner {
  background: @grey60-color;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;

  ul {
    margin: 4px;
    padding-inline-start: 16px;
  }
}

.ant-input-prefix {
  padding: 0 5px;
}

// no-bottom-line ant-tabs
.no-bottom-line .ant-tabs-nav::before {
  border: none;
}

// nz-switch no shadow & border
.ant-switch-handle::before {
  box-shadow: none;
  text-shadow: none;
  border: none;
}

.ant-picker-range {
  height: 40px;
  border-radius: 20px;
}

.find-rule {
  .ant-card {
    width: 100%;
  }

  .ant-card-head {
    border-bottom: none;
  }

  .ant-card-body {
    padding-top: 0;
  }
}

// multiple select placeholder
.ant-select-multiple .ant-select-selection-placeholder {
  top: 40%;
}

// table style
.table-content-area {
  width: 100%;
  border-radius: 20px;
  background-color: @grey5-color;

  .table-search-area {
    margin-bottom: 26px;
    padding: 44px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    border-radius: 20px;

    .search-inputs {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 16px;
    }

    // input group
    nz-input-group {
      width: 200px;
      height: 40px;
      border-radius: 32px;
      padding-left: 15px;

      i {
        font-size: 20px;
        color: @grey40-color;
      }
    }

    // primary button
    .ant-btn-primary {
      .standard-btn;
    }
  }
}

// custom pagination
.ant-pagination-options .ant-select-selector::after {
  right: 2px;
}

.ant-pagination .ant-table-pagination {
  line-height: 16px;
}

.custom-pagination-base {
  border: none;
  text-align: start;
  margin-top: 0.5px;

  i,
  .anticon-left,
  .anticon-right {
    display: none;
  }
}

.ant-pagination-prev .ant-pagination-item-link {
  .custom-pagination-base;

  &::before {
    display: inline-block;
    width: 24px;
    height: 24px;
    content: url("assets/icons/icon-left.svg");
  }
}

.ant-pagination-next .ant-pagination-item-link {
  .custom-pagination-base;

  &::before {
    display: inline-block;
    width: 24px;
    height: 24px;
    content: url("assets/icons/icon-right.svg");
  }
}

.ant-pagination-options-size-changer.ant-select .ant-select-selector {
  color: @grey40-color;
  border: 1px solid @grey30-color;
  background-color: @grey5-color;
}

.ant-pagination-item {
  border: none;
  border-radius: 4px;
  background-color: transparent;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  line-height: 150%;
  margin-top: 0.5px !important;

  a {
    color: @grey40-color;
  }
}

.ant-pagination-item-active {
  border: none;
  background: rgba(230, 255, 247, 0.6);
  border-radius: 8px;
  padding: 0 4px;

  a {
    color: @green60-color;
  }
}

.ant-pagination.mini .ant-pagination-options {
  margin-left: 12px;
}

// login tab style
.login-wrapper {
  .ant-tabs-top>.ant-tabs-nav {
    margin-bottom: 32px;
  }

  .ant-tabs-tab a,
  .ant-tabs-tab-btn {
    font-size: 18px;
    color: @grey50-color;
  }

  nz-input-group {
    width: 380px;
    height: 45px;
    border: 1px solid @grey20-color;
    border-radius: 8px;
    background: #FFFFFF;

    input {
      width: 100%;
      font-size: 14px;

      &::placeholder {
        color: @grey40-color;
      }
    }

    i {
      font-size: 20px;
      color: @grey50-color;
    }
  }
}

// custom card style
.ant-descriptions-title {
  display:flex;
  align-items: center;
  gap: 8px;
  color: @grey70-color;
  font-weight: 700;
  font-size: 18px;
  line-height: 150%;

  .ant-tag {
    margin-top: 4px;
    font-weight: 500;
  }
}

.ant-descriptions-extra {
  display: flex;
  align-items: center;
  gap: 8px;
}

// custom select dropdown and dropdown-menu
.ant-select-dropdown,
.ant-dropdown-menu {
  border-radius: 12px;
  box-shadow: 0 4px 12px 0 rgba(217, 217, 217, 0.5);
  padding: 4px;
}

.ant-select-item,
.ant-dropdown-menu-item {
  border-radius: 8px;
}

// segment & flag tabs padding
.tabs-container.segment-flag .ant-tabs-nav {
  padding-left: 24px !important;
  padding-top: 10px;
}

// custom nz-list
.ant-list-header {
  border-bottom: 1px solid @divider-color;
}

.overflow-y-list .ant-list-items {
  height: var(--list-height);
  overflow: auto;
}

// custom nz-divider
.ant-divider-vertical {
  margin: 0 24px;
  border-color: @divider-color;
}

// assures tabs take all available height
.ant-tabs-content {
  height: 100%;
}

.variation-tip {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 12px;
  margin-right: 6px;
}

.tip-0 {
  color: #7fffd4;
  background: #7fffd4;
  transform: rotate(-45deg);
}

.tip-1 {
  color: #1e90ff;
  background: #1e90ff;
  transform: rotate(-45deg);
}

.tip-2 {
  color: #2fee7e;
  background: #2fee7e;
  transform: rotate(-45deg);
}

.tip-3 {
  color: #ff1e44;
  background: #ff1e44;
  transform: rotate(-45deg);
}

.tip-4 {
  color: #a9ff1e;
  background: #a9ff1e;
  transform: rotate(-45deg);
}

.tip-5 {
  color: #a51eff;
  background: #a51eff;
  transform: rotate(-45deg);
}

.tip-6 {
  color: #ff1e1eab;
  background: #ff1e1eab;
  transform: rotate(-45deg);
}

.tip-7 {
  color: #ff8b1e;
  background: #ff8b1e;
  transform: rotate(-45deg);
}

.tip-8 {
  color: #96ff1e;
  background: #96ff1e;
  transform: rotate(-45deg);
}

.tip-9 {
  color: #1effb493;
  background: #1effb493;
  transform: rotate(-45deg);
}

.create-trigger .ant-select-selection-item {
  display: flex;
  align-items: center;

  i:first-child {
    margin-right: 6px;
  }

  .ant-tag.action {
    margin-left: 6px;
  }
}

.information-modal-dialog {
  .ant-btn {
    border-radius: 20px;
    width: 80px;
  }

  .ant-modal-confirm-content {
    margin-top: 24px;
  }
}

// custom nz-transfer
.ant-transfer-list {
  padding: 24px;
  border: 1px solid @grey20-color;
  border-radius: 20px;

  .dot {
    display: inline-block;
    content: ' ';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 12px;
  }

  &:first-child .ant-transfer-list-header-title::before {
    .dot;
    background: @grey30-color;
  }

  &:nth-child(3) .ant-transfer-list-header-title::before {
    .dot;
    background: @green60-color;
  }
}

.ant-transfer-disabled .ant-transfer-list {
  background-color: @grey5-color;
}

.ant-transfer-list-header-selected {
  color: @grey70-color;
  font-size: 14px;
  line-height: 150%;
}

.ant-transfer-list-header-title {
  font-size: 14px;
  line-height: 150%;
  color: @grey50-color;
}

.ant-transfer-list-body-with-search {
  .ant-transfer-list-content-item input {
    height: unset;
  }

  .ant-transfer-list-body-search-wrapper {
    padding: 10px 0;

    .ant-transfer-list-search {
      padding: 4px 8px;
      height: 40px;
      border-radius: 32px;

      input {
        height: auto;
      }

      .ant-input-prefix {
        font-size: 16px;
      }
    }
  }
}

.ant-transfer-operation {
  gap: 16px;
}

// custom checkbox
.ant-checkbox-inner {
  border: 2px solid #A8B0B9;
  background-color: white;

  .ant-checkbox-disabled {
    background-color: @grey20-color;
  }

  &::after {
    left: 17.5%;
    top: 45%;
  }
}

// custom radio
.ant-radio-inner {
  border-width: 2px;
}

// custom popover
.ant-popover-inner {
  border-radius: 10px;
  box-shadow: 0 4px 12px 0 rgba(217, 217, 217, 0.5);

  .ant-popover-buttons .ant-btn-sm {
    border-radius: 20px;
    padding: 0 12px;
  }
}

// more selected items popover, for [nzMaxTagPlaceholder]
.selected-items-popover {
  padding-bottom: 12px;

  .ant-popover-title {
    font-size: 14px;
    line-height: 150%;
    color: @grey90-color;
    border: none;
    padding: 8px 16px;
  }

  .ant-popover-inner-content {
    max-height: 120px;
    padding: 4px 16px 8px 16px;
    overflow-y: auto;

    .more-select-items {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      width: 306px;

      .more-select-item-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f5f5f5;
        border: 1px solid @grey0-color;
        border-radius: 2px;
        padding: 0 4px;

        width: 98px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        .more-select-item-content-text {
          width: 80px;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        i {
          background-color: rgba(0, 0, 0, 0);
          font-size: 10px;
          cursor: pointer;
          color: @grey40-color;
        }
      }
    }
  }

  .ant-popover-arrow {
    width: 10px;
    height: 10px;
  }

  .ant-popover-arrow-content {
    width: 10px;
    height: 10px;
    transform: translateY(-6px) rotate(45deg);
  }
}

// env secrets popover style
.env-secret-popover, .license-data-popover {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  background-color: transparent;

  .ant-popover-title {
    min-width: 177px;
    min-height: 40px;
    margin: 0;
    padding: 10px 16px 4px;
    color: rgba(0, 0, 0, 0.85);
    font-weight: 600;
    border-bottom: 1px solid @grey0-color;
  }

  .ant-popover-content {
    border-radius: 24px;
    padding-right: 10px;

    .ant-popover-inner {
      border-radius: 10px;
      border: 2px solid #bfd0e321;
      box-shadow: 0 4px 12px 0 rgb(217 217 217 / 0%);

      .ant-popover-inner-content {
        display: flex;
        flex-direction: column;
        gap: 5px;
      }
    }

    .env-secret-popover-content {
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;

      .copy-icon {
        font-size: 14px;
      }
    }

    .env-secret-popover-content:hover {
      color: @green70-color;
    }
  }
}

.license-data-popover {
  max-width: 100%;
}
// custom nz-alert
.ant-alert {
  padding: 24px;
  border-radius: 10px;
  border-color: transparent;
  color: @grey60-color;
  font-size: 14px;
  line-height: 150%;
}

.ant-alert-error {
  background-color: @red5-color;

  .ant-alert-icon {
    font-size: 20px;
    margin-right: 12px;
    color: @red50-color;
  }
}

.ant-alert-warning {
  background-color: @yellow10-color;

  .ant-alert-icon {
    font-size: 20px;
    margin-right: 12px;
    color: @yellow55-color;
  }
}

// custom notification
.ant-notification-notice {
  border-radius: 8px;
}

.primary-link-btn {
  color: #23AD7F;
}

// enable ant-input-suffix pointer events
.ant-input-suffix {
  pointer-events: unset;
}

// custom nz-tag
.ant-tag {
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
  padding: 2px 8px;
  margin: 0 4px;
}

.drawer-footer-btn {
  display: flex;
  justify-content: flex-end;

  button {
    border-radius: 30px;
  }
}

.copy-icon {
  cursor: pointer;
  margin: 0 4px;
  &:hover {
    color: @green60-color;
  }
}

.creation-selection-item {
  color: @primary-color;
  font-weight: 600;
}
